 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

媒体处理相关接口
多媒体处理服务API，包括截图、转码、媒体处理消息通知等操作。本文档详细说明了媒体处理API及用法，适合开发人员阅读。

OpenAPI spec version: v1
Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKMps/MpsModel.h>

@implementation StyleDelimiterConf
-(id) initWithDelimiters:(NSArray<NSString*>*) delimiters { 
     self.delimiters = delimiters;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self delimiters])
    {
        [result setValue:[self delimiters] forKey:@"delimiters"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.delimiters = [dictionary objectForKey:@"delimiters"];
    return self;
}
 @end
@implementation ImageStyleCount
-(id) initWithStyleCount:(NSNumber*) styleCount { 
     self.styleCount = styleCount;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self styleCount])
    {
        [result setValue:[self styleCount] forKey:@"styleCount"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.styleCount = [dictionary objectForKey:@"styleCount"];
    return self;
}
 @end
@implementation ImageStyleID
-(id) initWithId:(NSNumber*) idValue { 
     self.idValue = idValue;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idValue = [dictionary objectForKey:@"id"];
    return self;
}
 @end
@implementation ImageStyle
-(id) initWithId:(NSNumber*) idValue
      userId:(NSString*)userId
      styleName:(NSString*)styleName
      params:(NSString*)params
      paramAlias:(NSString*)paramAlias
      regionId:(NSString*)regionId
      bucketName:(NSString*)bucketName
      status:(NSNumber*)status
      modifyTime:(NSString*)modifyTime
      createdTime:(NSString*)createdTime { 
     self.idValue = idValue;               
     self.userId = userId;               
     self.styleName = styleName;               
     self.params = params;               
     self.paramAlias = paramAlias;               
     self.regionId = regionId;               
     self.bucketName = bucketName;               
     self.status = status;               
     self.modifyTime = modifyTime;               
     self.createdTime = createdTime;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    if([self userId])
    {
        [result setValue:[self userId] forKey:@"userId"];
    }
    if([self styleName])
    {
        [result setValue:[self styleName] forKey:@"styleName"];
    }
    if([self params])
    {
        [result setValue:[self params] forKey:@"params"];
    }
    if([self paramAlias])
    {
        [result setValue:[self paramAlias] forKey:@"paramAlias"];
    }
    if([self regionId])
    {
        [result setValue:[self regionId] forKey:@"regionId"];
    }
    if([self bucketName])
    {
        [result setValue:[self bucketName] forKey:@"bucketName"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self modifyTime])
    {
        [result setValue:[self modifyTime] forKey:@"modifyTime"];
    }
    if([self createdTime])
    {
        [result setValue:[self createdTime] forKey:@"createdTime"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idValue = [dictionary objectForKey:@"id"];
    self.userId = [dictionary objectForKey:@"userId"];
    self.styleName = [dictionary objectForKey:@"styleName"];
    self.params = [dictionary objectForKey:@"params"];
    self.paramAlias = [dictionary objectForKey:@"paramAlias"];
    self.regionId = [dictionary objectForKey:@"regionId"];
    self.bucketName = [dictionary objectForKey:@"bucketName"];
    self.status = [dictionary objectForKey:@"status"];
    self.modifyTime = [dictionary objectForKey:@"modifyTime"];
    self.createdTime = [dictionary objectForKey:@"createdTime"];
    return self;
}
 @end
@implementation ThumbnailTaskRule
-(id) initWithMode:(NSString*) mode
      keyFrame:(NSNumber*)keyFrame
      startTimeInSecond:(NSNumber*)startTimeInSecond
      endTimeInSecond:(NSNumber*)endTimeInSecond
      count:(NSNumber*)count { 
     self.mode = mode;               
     self.keyFrame = keyFrame;               
     self.startTimeInSecond = startTimeInSecond;               
     self.endTimeInSecond = endTimeInSecond;               
     self.count = count;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self mode])
    {
        [result setValue:[self mode] forKey:@"mode"];
    }
    if([self keyFrame])
    {
        [result setValue:[self keyFrame] forKey:@"keyFrame"];
    }
    if([self startTimeInSecond])
    {
        [result setValue:[self startTimeInSecond] forKey:@"startTimeInSecond"];
    }
    if([self endTimeInSecond])
    {
        [result setValue:[self endTimeInSecond] forKey:@"endTimeInSecond"];
    }
    if([self count])
    {
        [result setValue:[self count] forKey:@"count"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.mode = [dictionary objectForKey:@"mode"];
    self.keyFrame = [dictionary objectForKey:@"keyFrame"];
    self.startTimeInSecond = [dictionary objectForKey:@"startTimeInSecond"];
    self.endTimeInSecond = [dictionary objectForKey:@"endTimeInSecond"];
    self.count = [dictionary objectForKey:@"count"];
    return self;
}
 @end
@implementation ThumbnailTaskSource
-(id) initWithBucket:(NSString*) bucket
      key:(NSString*)key { 
     self.bucket = bucket;               
     self.key = key;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self bucket])
    {
        [result setValue:[self bucket] forKey:@"bucket"];
    }
    if([self key])
    {
        [result setValue:[self key] forKey:@"key"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.bucket = [dictionary objectForKey:@"bucket"];
    self.key = [dictionary objectForKey:@"key"];
    return self;
}
 @end
@implementation ThumbnailStatus
-(id) initWithStatus:(NSString*) status
      errorCode:(NSNumber*)errorCode
      count:(NSNumber*)count { 
     self.status = status;               
     self.errorCode = errorCode;               
     self.count = count;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self errorCode])
    {
        [result setValue:[self errorCode] forKey:@"errorCode"];
    }
    if([self count])
    {
        [result setValue:[self count] forKey:@"count"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.status = [dictionary objectForKey:@"status"];
    self.errorCode = [dictionary objectForKey:@"errorCode"];
    self.count = [dictionary objectForKey:@"count"];
    return self;
}
 @end
@implementation Notification
-(id) initWithEnabled:(NSNumber*) enabled
      endpoint:(NSString*)endpoint
      events:(NSArray<NSString*>*)events
      notifyStrategy:(NSString*)notifyStrategy
      notifyContentFormat:(NSString*)notifyContentFormat { 
     self.enabled = enabled;               
     self.endpoint = endpoint;               
     self.events = events;               
     self.notifyStrategy = notifyStrategy;               
     self.notifyContentFormat = notifyContentFormat;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self enabled])
    {
        [result setValue:[self enabled] forKey:@"enabled"];
    }
    if([self endpoint])
    {
        [result setValue:[self endpoint] forKey:@"endpoint"];
    }
    if([self events])
    {
        [result setValue:[self events] forKey:@"events"];
    }
    if([self notifyStrategy])
    {
        [result setValue:[self notifyStrategy] forKey:@"notifyStrategy"];
    }
    if([self notifyContentFormat])
    {
        [result setValue:[self notifyContentFormat] forKey:@"notifyContentFormat"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.enabled = [dictionary objectForKey:@"enabled"];
    self.endpoint = [dictionary objectForKey:@"endpoint"];
    self.events = [dictionary objectForKey:@"events"];
    self.notifyStrategy = [dictionary objectForKey:@"notifyStrategy"];
    self.notifyContentFormat = [dictionary objectForKey:@"notifyContentFormat"];
    return self;
}
 @end
@implementation ThumbnailTaskTarget
-(id) initWithDestBucket:(NSString*) destBucket
      destKeyPrefix:(NSString*)destKeyPrefix
      format:(NSString*)format
      widthInPixel:(NSNumber*)widthInPixel
      heightInPixel:(NSNumber*)heightInPixel
      keys:(NSArray<NSString*>*)keys { 
     self.destBucket = destBucket;               
     self.destKeyPrefix = destKeyPrefix;               
     self.format = format;               
     self.widthInPixel = widthInPixel;               
     self.heightInPixel = heightInPixel;               
     self.keys = keys;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self destBucket])
    {
        [result setValue:[self destBucket] forKey:@"destBucket"];
    }
    if([self destKeyPrefix])
    {
        [result setValue:[self destKeyPrefix] forKey:@"destKeyPrefix"];
    }
    if([self format])
    {
        [result setValue:[self format] forKey:@"format"];
    }
    if([self widthInPixel])
    {
        [result setValue:[self widthInPixel] forKey:@"widthInPixel"];
    }
    if([self heightInPixel])
    {
        [result setValue:[self heightInPixel] forKey:@"heightInPixel"];
    }
    if([self keys])
    {
        [result setValue:[self keys] forKey:@"keys"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.destBucket = [dictionary objectForKey:@"destBucket"];
    self.destKeyPrefix = [dictionary objectForKey:@"destKeyPrefix"];
    self.format = [dictionary objectForKey:@"format"];
    self.widthInPixel = [dictionary objectForKey:@"widthInPixel"];
    self.heightInPixel = [dictionary objectForKey:@"heightInPixel"];
    self.keys = [dictionary objectForKey:@"keys"];
    return self;
}
 @end
@implementation TranscodeStatus
-(id) initWithStatus:(NSString*) status
      errorCode:(NSNumber*)errorCode
      notifyMessage:(NSString*)notifyMessage { 
     self.status = status;               
     self.errorCode = errorCode;               
     self.notifyMessage = notifyMessage;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self errorCode])
    {
        [result setValue:[self errorCode] forKey:@"errorCode"];
    }
    if([self notifyMessage])
    {
        [result setValue:[self notifyMessage] forKey:@"notifyMessage"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.status = [dictionary objectForKey:@"status"];
    self.errorCode = [dictionary objectForKey:@"errorCode"];
    self.notifyMessage = [dictionary objectForKey:@"notifyMessage"];
    return self;
}
 @end
@implementation ThumbnailTaskID
-(id) initWithTaskID:(NSString*) taskID { 
     self.taskID = taskID;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self taskID])
    {
        [result setValue:[self taskID] forKey:@"taskID"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.taskID = [dictionary objectForKey:@"taskID"];
    return self;
}
 @end
@implementation ImageStyleQueryResult
-(id) initWithStyleName:(NSString*) styleName
      pageNumber:(NSNumber*)pageNumber
      pageSize:(NSNumber*)pageSize
      imageStyleList:(NSArray<ImageStyle*>*)imageStyleList { 
     self.styleName = styleName;               
     self.pageNumber = pageNumber;               
     self.pageSize = pageSize;               
     self.imageStyleList = imageStyleList;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self styleName])
    {
        [result setValue:[self styleName] forKey:@"styleName"];
    }
    if([self pageNumber])
    {
        [result setValue:[self pageNumber] forKey:@"pageNumber"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    if([self imageStyleList])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self imageStyleList] count]; i++) {
            ImageStyle* item = [[self imageStyleList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"imageStyleList"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.styleName = [dictionary objectForKey:@"styleName"];
    self.pageNumber = [dictionary objectForKey:@"pageNumber"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    NSArray* imageStyleListArray = [dictionary objectForKey:@"imageStyleList"];
    if(imageStyleListArray&&![imageStyleListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [imageStyleListArray count];i++)
        {
            ImageStyle* item = [[ImageStyle alloc]initWithDic:[imageStyleListArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.imageStyleList = propertyArray;
    }
    return self;
}
 @end
@implementation ThumbnailTask
-(id) initWithTaskID:(NSString*) taskID
      status:(NSString*)status
      errorCode:(NSNumber*)errorCode
      createdTime:(NSString*)createdTime
      lastUpdatedTime:(NSString*)lastUpdatedTime
      source:(ThumbnailTaskSource*)source
      target:(ThumbnailTaskTarget*)target
      rule:(ThumbnailTaskRule*)rule { 
     self.taskID = taskID;               
     self.status = status;               
     self.errorCode = errorCode;               
     self.createdTime = createdTime;               
     self.lastUpdatedTime = lastUpdatedTime;               
     self.source = source;               
     self.target = target;               
     self.rule = rule;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self taskID])
    {
        [result setValue:[self taskID] forKey:@"taskID"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self errorCode])
    {
        [result setValue:[self errorCode] forKey:@"errorCode"];
    }
    if([self createdTime])
    {
        [result setValue:[self createdTime] forKey:@"createdTime"];
    }
    if([self lastUpdatedTime])
    {
        [result setValue:[self lastUpdatedTime] forKey:@"lastUpdatedTime"];
    }
    if([self source])
    {
        [result setValue:[[self source] dictionary]forKey:@"source"];
    }
    if([self target])
    {
        [result setValue:[[self target] dictionary]forKey:@"target"];
    }
    if([self rule])
    {
        [result setValue:[[self rule] dictionary]forKey:@"rule"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.taskID = [dictionary objectForKey:@"taskID"];
    self.status = [dictionary objectForKey:@"status"];
    self.errorCode = [dictionary objectForKey:@"errorCode"];
    self.createdTime = [dictionary objectForKey:@"createdTime"];
    self.lastUpdatedTime = [dictionary objectForKey:@"lastUpdatedTime"];
    self.source = [[ThumbnailTaskSource alloc]initWithDic:[dictionary objectForKey:@"source"]];
    self.target = [[ThumbnailTaskTarget alloc]initWithDic:[dictionary objectForKey:@"target"]];
    self.rule = [[ThumbnailTaskRule alloc]initWithDic:[dictionary objectForKey:@"rule"]];
    return self;
}
 @end
@implementation ThumbnailQuery
-(id) initWithStatus:(NSString*) status
      begin:(NSString*)begin
      end:(NSString*)end
      marker:(NSString*)marker
      limit:(NSNumber*)limit
      nextMarker:(NSString*)nextMarker
      truncated:(NSNumber*)truncated
      taskList:(NSArray<ThumbnailTask*>*)taskList { 
     self.status = status;               
     self.begin = begin;               
     self.end = end;               
     self.marker = marker;               
     self.limit = limit;               
     self.nextMarker = nextMarker;               
     self.truncated = truncated;               
     self.taskList = taskList;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self begin])
    {
        [result setValue:[self begin] forKey:@"begin"];
    }
    if([self end])
    {
        [result setValue:[self end] forKey:@"end"];
    }
    if([self marker])
    {
        [result setValue:[self marker] forKey:@"marker"];
    }
    if([self limit])
    {
        [result setValue:[self limit] forKey:@"limit"];
    }
    if([self nextMarker])
    {
        [result setValue:[self nextMarker] forKey:@"nextMarker"];
    }
    if([self truncated])
    {
        [result setValue:[self truncated] forKey:@"truncated"];
    }
    if([self taskList])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self taskList] count]; i++) {
            ThumbnailTask* item = [[self taskList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"taskList"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.status = [dictionary objectForKey:@"status"];
    self.begin = [dictionary objectForKey:@"begin"];
    self.end = [dictionary objectForKey:@"end"];
    self.marker = [dictionary objectForKey:@"marker"];
    self.limit = [dictionary objectForKey:@"limit"];
    self.nextMarker = [dictionary objectForKey:@"nextMarker"];
    self.truncated = [dictionary objectForKey:@"truncated"];
    NSArray* taskListArray = [dictionary objectForKey:@"taskList"];
    if(taskListArray&&![taskListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [taskListArray count];i++)
        {
            ThumbnailTask* item = [[ThumbnailTask alloc]initWithDic:[taskListArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.taskList = propertyArray;
    }
    return self;
}
 @end
 
 


